const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  publicPath: "./",
  outputDir: "smart",
  transpileDependencies: true,
  devServer: {
    proxy: {
      "/smart": {
        target: "https://shopapi.smartisan.com",
        pathRewrite: {
          //重写路径，剔除多余的代理路径
          "^/smart": "",
        },
        // 重写前：
        // https://shopapi.smartisan.com/smart/product/home
        // 重写后:
        // https://shopapi.smartisan.com/product/home
      },
      "/local": {
        target: "http://localhost:3000",
        pathRewrite: {
          //重写路径，剔除多余的代理路径
          "^/local": "",
        },
      },
      "/node": {
        target: "http://localhost:3001",
        pathRewrite: {
          //重写路径，剔除多余的代理路径
          "^/node": "",
        },
      },
    },
  },
});
